package org.stream.answerduel.vo;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;

import org.springframework.beans.BeanUtils;
import org.stream.answerduel.entity.User;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import lombok.extern.slf4j.Slf4j;

import java.io.Serializable;

@ApiModel("封装的用户信息:UserVo")
@Slf4j
@Data
@Accessors(chain = true)
public class UserVo implements Serializable {
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty
    private Long id;

    @ApiModelProperty
    private String wechatID;

    @ApiModelProperty
    private String nickName;

    @ApiModelProperty
    private String avatarUrl;

    @ApiModelProperty
    private String token;

    @ApiModelProperty
    private int score;

    @ApiModelProperty
    private int winCount;

    @ApiModelProperty
    private int loseCount;

    @ApiModelProperty
    private int drawCount;

    @ApiModelProperty
    private int rightCount;

    @ApiModelProperty
    private int wrongCount;

    public UserVo()
    {

    }

    public UserVo(User user)
    {
        BeanUtils.copyProperties(user, this);
    }
}